<template>
	<view>
		<view class="whole">
			<view>
				<view class="Cardnumber">
					<text>一卡通&nbsp;&nbsp;|&nbsp;&nbsp;NO.{{data.no}}</text>
				</view>
				<view class="Prompttext">
					<view>余额</view>
					<view>有效期</view>
				</view>
				<view class="text">
					<view>￥{{data.total}}</view>
					<view>{{data.expireDatef}}</view>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>卡号: {{data.no}}</text></view>
				</view>
			</view>
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>卡类型: {{data.groupName}}</text></view>
				</view>
			</view>
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>主账户余额: {{data.balance}}</text></view>
				</view>
			</view>
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>补贴账户余额: {{data.subsidy}}</text></view>
				</view>
			</view>
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>合计余额: {{data.total}}</text></view>
				</view>
			</view>
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>创建时间: {{data.createDate}}</text></view>
				</view>
			</view>
			<view class="row">
				<view class="row_cent">
					<view class="text"><text>有效期: {{data.expireDate}}</text></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:{},
				no:'',
			}
		},
		onLoad() {
			//获取一卡通信息
			this.no=uni.getStorageSync('idCard')
			// this.no = '450203194309090748'
			this.getcard()
			
		},
		methods: {
			//获取一卡通信息
			async getcard() {
				const res = await this.$dietRequest({
					url: '/api-baiyun/dish/getCardBance/'+this.no,
					method: "get",
				})
				if (res.success == true) {
					this.data = res.data;
					this.data.expireDatef=res.data.expireDate.split(" ")[0]
				}
			},
			onNavigationBarButtonTap(e){
				uni.navigateTo({
					url: '/pages/card/xaiofeizhangdan'
				})
			}
		},
	}
</script>

<style lang="less">
	.whole{
		color: #FFFFFF;
		margin: 40rpx 5%;
		height: 400rpx;
		width: 90%;
		background-image: url("../../static/image/cardBG@2x.png") ;
		background-repeat:no-repeat;
		background-size:contain;
		z-index: -1;
	}
	.Cardnumber{
		font-weight:bold;
		padding: 5% 0 0 10%;
	}
	.Prompttext{
		padding-top: 20%;
		display: flex;
		margin:  0 auto;
		width: 80%;
		justify-content:  space-between;
	}
	.text{
		font-weight:bold;
		display: flex;
		margin:  0 auto;
		width: 80%;
		justify-content:  space-between;
	}
	.list{
		margin: 40rpx 5%;
		width: 90%;
		.row {
			margin-top: 20rpx;
			font-weight: bold;
			height: 80rpx;
			color: #FFFFFF;
			background-color: #FF8B96;
			width: 100%;
			border-radius: 25rpx;
			.row_cent{
				// margin-left: 10%;
				align-items: center;
				height: 100%;
				display: flex;
			}
		}
	}
	
	
</style>
